<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../css/main-page.css" />
<script type="text/javascript" src="../easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="../easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function initForm(){
		$('#fm').form({
			url : "../user/changePassword.do",  
		    onSubmit: function(){
		        var oldPwd = $("#oldPwd").val();
		        if($.trim(oldPwd) == ""){
		        	$.messager.alert("提示",'<br />请输入原始密码！','info');
		        	return false;
		        }
		        var newPwd = $("#newPwd").val();
		        if($.trim(newPwd) == ""){
		        	$.messager.alert("提示",'<br />请输入新密码！','info');
		        	return false;
		        }
		        var newPwd1 = $("#newPwd1").val();
		        if($.trim(newPwd1) == ""){
		        	$.messager.alert("提示",'<br />请输入确认密码！','info');
		        	return false;
		        }
		        if(newPwd != newPwd1){
		        	$.messager.alert("提示",'<br />新密码和确认密码不一致！','info');
		        	return false;
				}
		        return true;
		    },  
		    success:function(msg){
		        $.messager.alert('info','<br />' + msg);
		    }
		});  
	}
	
	$(function(){
		initForm();
	});
</script>
</head>
<body>
	<form id="fm" method="post">
		<div class="dg-content">
			<table style="margin-top: 30px" cellspacing="10px">
				<tr>
					<td align="right" style="padding-right: 5px;width: 30%">原密码</td>
					<td><input type="password" id="oldPwd" name="oldPwd" class='in-text'/>
						<font color="red">&nbsp;*</font>
					</td>
				</tr>
				<tr>
					<td align="right" style="padding-right: 5px">新密码</td>
					<td><input type="password" id="newPwd" name="newPwd" class='in-text'/>
						<font color="red">&nbsp;*</font>
					</td>
				</tr>
				<tr>
					<td align="right" style="padding-right: 5px">确认密码</td>
					<td><input type='password' id="newPwd1" name="newPwd1" class='in-text'/>
						<font color="red">&nbsp;*</font>
					</td>
				</tr>
				<tr>
					<td align="center" colspan="2">
						<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="$('#fm').submit();">确定</a>
					</td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>